Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
babel-plugin-polyfill-corejs3
Advanced tools
The babel-plugin-polyfill-corejs3 package is a plugin for Babel that automatically includes the necessary core-js polyfills based on the code being transpiled and the target environments specified in the Babel configuration. It helps developers to use modern JavaScript features without worrying about the support in older environments, as it takes care of loading the necessary shims and polyfills.
Automatic Polyfilling
Automatically includes necessary polyfills for features used in the code that are not supported in the target environments.
require('core-js');
Modular Polyfills
Allows for modular inclusion of polyfills, adding only the polyfills needed for specific features used in the code.
require('core-js/modules/es.array.iterator');
Configurable Target Environments
Enables configuration of target environments to determine which polyfills are needed based on browser or node version support.
presets: [['@babel/preset-env', { targets: '> 0.25%, not dead' }]]
A Babel preset that automatically determines the Babel plugins and polyfills you need based on your supported environments. It is similar to babel-plugin-polyfill-corejs3 but includes both plugins and preset configurations.
A modular standard library for JavaScript, which includes polyfills for ECMAScript up to 2021. It can be used directly without Babel, but babel-plugin-polyfill-corejs3 utilizes it under the hood.
A deprecated package that provided polyfills for older environments. It was replaced by the combination of core-js and regenerator-runtime, which babel-plugin-polyfill-corejs3 now handles more efficiently.
Using npm:
npm install --save-dev babel-plugin-polyfill-corejs3
or using yarn:
yarn add babel-plugin-polyfill-corejs3 --dev
Add this plugin to your Babel configuration:
{
"plugins": [["polyfill-corejs3", { "method": "usage-global" }]]
}
This package supports the usage-pure
, usage-global
, and entry-global
methods.
When entry-global
is used, it replaces imports to core-js
.
FAQs
A Babel plugin to inject imports to core-js@3 polyfills
The npm package babel-plugin-polyfill-corejs3 receives a total of 19,706,331 weekly downloads. As such, babel-plugin-polyfill-corejs3 popularity was classified as popular.
We found that babel-plugin-polyfill-corejs3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.